package day240429.superkeyword;

public class Duck extends Animal {
    String zoo;

    public Duck(String zoo) {
        //the superclass no-argument constructor is called
        super();
        this.zoo = zoo;
    }
    public Duck(String zoo,String id){
        super(id);
        //下面代码会报错，Only one explicit constructor call allowed in constructor
        //super();
        this.zoo=zoo;
    }
    public Duck(String name,String id,int age){
        // 如果没有在子类的构造器中显式的调用父类的构造器
        this.name=name;
        this.id=id;
        this.age=age;
        
    }
}
